﻿#pragma once

#include "MirControl.h"
#include "../../Shared/Data/ItemData.h"
#include "MirLabel.h"
#include "MirImageControl.h"
#include <vector>
#include "../../stringhelper.h"

using namespace Client::MirGraphics;
using namespace Client::MirScenes;
using namespace SlimDX;

namespace Client::MirControls
{
    class MirGoodsCell final : public MirControl
    {
    public:
        UserItem *Item;

        MirLabel *NameLabel, *PriceLabel, *CountLabel;
        bool UsePearls = false;
        bool Recipe = false;

        bool MultipleAvailable = false;
        MirImageControl *NewIcon;

        virtual ~MirGoodsCell()
        {
            delete Item;
            delete NameLabel;
            delete PriceLabel;
            delete CountLabel;
            delete NewIcon;
        }

        MirGoodsCell();

    private:
        void Update();

    protected:
        std::vector<Vector2*> getBorderInfo() const override;

        void OnMouseEnter() override;

        void OnMouseLeave() override;

    private:
        void DrawItem();
    };
}
